$(function () {
    //发送ajax请求拿到快速入口数据:
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getindexmenu",
        dataType: "json",
        success: function (res) {
            console.log(res);
            res.result.forEach((v, i, arr) => {
                arr[i].img = v.img.replace('images', './images')
            })
            let html = template('quickCenterTmp', {
                data: res.result
            });
            $('.quickCenter').html(html)
            //拿到最后四个元素：
            let ele  = $('.item').eq(7);
            let eles = $(ele).nextAll();
            //拿到更多点击按钮:
            ele.click(function(){
                eles.fadeToggle()
            })
        }
    });

    //推荐商品数据：
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getmoneyctrl",
        dataType: "json",
        success: function (res) {
            let html = template('superlistTmp',{
                data:res.result
            })
            $('.product_list').html(html);
        }
    });
})